babl/babl.h renamed babl_format_get_num_of_components() to
authorSven Neumann <sven@gimp.org>
Mon, 26 Jan 2009 08:59:14 +0000 (08:59 +0000)
committerSven Neumann <neo@src.gnome.org>
Mon, 26 Jan 2009 08:59:14 +0000 (08:59 +0000)
2009-01-26  Sven Neumann  <sven@gimp.org>

* babl/babl.h
* babl/babl-format.c: renamed
babl_format_get_num_of_components()
to babl_format_get_n_components().
(babl_format_has_alpha): changed accordingly.

svn path=/trunk/; revision=391

ChangeLog
babl/babl-format.c
babl/babl.h

index 126762b9a035914e94c1a627ca034715b9a435d3..175f9a82df89c51e2a9c46e94d148a7af0c1bd43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-26  Sven Neumann  <sven@gimp.org>
+
+       * babl/babl.h
+       * babl/babl-format.c: renamed babl_format_get_num_of_components()
+       to babl_format_get_n_components().
+       (babl_format_has_alpha): changed accordingly.
+
 2009-01-24  Martin Nordholts  <martinn@svn.gnome.org>
 
        Do a complete overhaul of the babl API.
index 45dfa0512c1fc48b70bad11f545f1f71aee1aa33..a9f68787937cd68132d27d7378fc4bb20b8a097b 100644 (file)
@@ -331,19 +331,18 @@ babl_formats_count (void)
 int
 babl_format_has_alpha (const Babl *format)
 {
+  int n = babl_format_get_n_components (format);
   int i;
-  int has_alpha = 0;
 
-  for (i = 0; i < babl_format_get_num_of_components (format); i++)
+  for (i = 0; i < n; i++)
     {
       if (format->format.component[i]->alpha)
         {
-          has_alpha = 1;
-          break;
+          return 1;
         }
     }
 
-  return has_alpha;
+  return 0;
 }
 
 int
@@ -358,7 +357,7 @@ babl_format_get_bytes_per_pixel (const Babl *format)
 }
 
 int
-babl_format_get_num_of_components (const Babl *format)
+babl_format_get_n_components (const Babl *format)
 {
   if (format->class_type == BABL_FORMAT)
     {
index bd538393c70a5e872798f2858859f3e209ac4785..e8d6fcae4a05da369b97943456b35853150be3e4 100644 (file)
@@ -103,7 +103,7 @@ int          babl_format_get_bytes_per_pixel   (const Babl *format);
 /**
  * Returns the number of components for the given @format.
  */
-int          babl_format_get_num_of_components (const Babl *format);
+int          babl_format_get_n_components      (const Babl *format);
 
 /**
  * Returns the type in the given @format for the given